import request from "../../util/serve"

//商品列表
export let shop = (current, size) => {
    return request({
        url: 'goods/getAll',
        method: 'GET',
        params: {
            current, size
        }
    })
}
//添加商品
export let update = (favprice, gid, imgurl, price, proid, proname, tool) => {
    return request({
        url: 'goods/update',
        method: 'POST',
        data: {
            favprice, gid,
            imgurl,
            price, proid,
            proname,
            tool
        }
    })
}
//单删商品
export let goodsdelete = (id) => {
    return request({
        url: 'goods/delete',
        method: 'DELETE',
        params: {
            id
        }
    })
}
//全删商品
export let remove = (idList) => {
    return request({
        url: '/goods/removes',
        method: 'DELETE',
        params: {
            idList
        }
    })
}
//搜索商品
export let goodsblursearch = (current, key, size) => {
    return request({
        url: 'goods/blursearch',
        method: 'GET',
        params: {
            current, key, size
        }
    })
}
//精准搜索
export let goodssearch = (current, key, size) => {
    return request({
        url: '/goods/search',
        method: 'GET',
        params: {
            current, key, size
        }
    })
}
//多条件查询搜索商品
export let goodssearchAll = (current, map, size) => {
    return request({

        url: 'goods/searchAll',
        method: 'GET',
        params: {
            current, map, size
        }
    })
}

